﻿using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.IdentityServer.Clients;
using Volo.Abp.Validation;

namespace LINGYUN.Abp.IdentityServer.Clients;

public class ClientCreateOrUpdateDto
{
    [Required]
    [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.ClientIdMaxLength))]
    public string ClientId { get; set; }

    [Required]
    [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.ClientNameMaxLength))]
    public string ClientName { get; set; }

    [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.DescriptionMaxLength))]
    public string Description { get; set; }

    public List<ClientGrantTypeDto> AllowedGrantTypes { get; set; }

    protected ClientCreateOrUpdateDto()
    {
        AllowedGrantTypes = new List<ClientGrantTypeDto>();
    }
}
